<?php
class Admin_Model_DbTable_career extends Zend_Db_Table_Abstract
{
	 protected $_name = 'hae_career';
	 protected $_sequence=true;
     protected $_primary='id';
	public function getcareer($id)
	{
	    $id = (int)$id;
	    $row = $this->fetchRow('id=' . $id);
		if(!$row)
		{ 
			throw  new Exception("Could not find row {$id}");
		}
		return $row->toArray();
	}
	
	public function addcareer($name_vi,$name_en,$name_ja,$name_cn,$name_fr,$desc_vi,$desc_en, $desc_ja, $desc_cn, $desc_fr, $status, $priority, $alias)
	{
	    
		$data = array(
		'name_vi'   => $name_vi,
		'name_en'   => $name_en,
		'name_ja'   => $name_ja,
		'name_cn'   => $name_cn,
		'name_fr'   => $name_fr,
		'desc_vi' => $desc_vi,
		'desc_en' => $desc_en,
		'desc_ja' => $desc_ja,
		'desc_cn' => $desc_cn,
		'desc_fr' => $desc_fr,
		'status' => $status,
		'priority' => $priority,
		'alias'   => $alias,
		);
		$this->insert($data);
	}
	public function updatecareer($id,$name_vi,$name_en,$name_ja,$name_cn,$name_fr,$desc_vi, $desc_en, $desc_ja, $desc_cn, $desc_fr, $status, $priority, $alias)
	{
		$data = array(
		'name_vi'   => $name_vi,
		'name_en'   => $name_en,
		'name_ja'   => $name_ja,
		'name_cn'   => $name_cn,
		'name_fr'   => $name_fr,
		'desc_vi' => $desc_vi,
		'desc_en' => $desc_en,
		'desc_ja' => $desc_ja,
		'desc_cn' => $desc_cn,
		'desc_fr' => $desc_fr,
		'status' => $status,
		'priority' => $priority,
		'alias'    => $alias,
		);
		$this->update($data, 'id = '. (int)$id);
	}
	public function deletecareer($id)
    {
        return $this->delete('id =' . (int)$id);
    }
}
?>